@import "dark-theme.css";
:root {
  --primary-color: #4CAF50;
  --primary-dark: #45a049;
  --primary-light: #81C784;
  --error-color: #f44336;
  --error-dark: #d32f2f;
  --success-color: #4CAF50;
  --success-light: #81C784;
  --warning-color: #ff9800;
  --warning-dark: #f57c00;
  --info-color: #2196F3;
  --info-dark: #1976D2;
  --light-gray: #f5f5f5;
  --light-gray-dark: #e0e0e0;
  --dark-gray: #666;
  --dark-gray-dark: #444;
  --border-color: #ddd;
  --border-color-dark: #bbb;
  --text-color: #333;
  --text-color-dark: #111;
  --bg-color: #f5f5f5;
  --bg-color-dark: #eaeaea;
  --container-bg: #ffffff;
  --container-bg-dark: #f9f9f9;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-dark: 0 2px 15px rgba(0,0,0,0.2);
  --transition: all 0.3s ease;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.container {
  background-color: var(--container-bg);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

h1 {
  color: var(--text-color);
  margin-bottom: 10px;
}

h2 {
  color: var(--primary-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

h3 {
  color: var(--dark-gray);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 15px;
}

a:hover {
  text-decoration: underline;
}

.endpoint {
  background-color: #f9f9f9;
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 4px 4px 0;
}

code {
  background-color: #f1f1f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

pre {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
}

.form-group {
  margin: 15px 0;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input, 
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  margin: 5px 10px 5px 0;
  font-size: 14px;
}

.btn:hover {
  background-color: var(--primary-dark);
}

.btn-danger {
  background-color: var(--error-color);
}

.btn-danger:hover {
  background-color: #d32f2f;
}

.btn-warning {
  background-color: var(--warning-color);
  color: white;
}

.btn-warning:hover {
  background-color: #f57c00;
}

.btn-info {
  background-color: var(--info-color);
}

.btn-info:hover {
  background-color: #1976D2;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.user-list, .post-list, .category-list, .comment-list {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.user-item, .post-item, .category-item, .comment-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  position: relative;
}

.user-item:last-child, .post-item:last-child, .category-item:last-child, .comment-item:last-child {
  border-bottom: none;
}

.user-actions, .post-actions, .category-actions, .comment-actions {
  display: flex;
  gap: 10px;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  background-color: #f1f1f1;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  margin-right: 5px;
  transition: all 0.3s;
}

.tab.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.feature-list {
  margin: 20px 0;
}

.feature-list li {
  margin: 10px 0;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.post-content {
  line-height: 1.6;
  color: #555;
}

.post-meta {
  color: var(--dark-gray);
  font-size: 14px;
  margin: 10px 0;
}

.post-excerpt {
  margin: 10px 0;
}

.nav-links {
  margin: 20px 0;
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.pagination button {
  margin: 0 5px;
}

.search-box {
  margin: 20px 0;
}

.search-box input {
  padding: 10px;
  width: 300px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
  transition: var(--transition);
  background-color: var(--container-bg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary-color);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.card:hover::before {
  transform: scaleY(1);
}

.card-header {
  font-weight: bold;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.comment-form {
  background-color: var(--light-gray);
  padding: 15px;
  border-radius: 4px;
  margin: 15px 0;
}

.comment-item {
  flex-direction: column;
  align-items: flex-start;
  transition: var(--transition);
  position: relative;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.comment-item:hover {
  background-color: rgba(76, 175, 80, 0.05);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-content {
  margin: 10px 0;
  padding: 10px;
  background-color: var(--light-gray);
  border-radius: 4px;
  width: 100%;
}

.comment-meta {
  color: var(--dark-gray);
  font-size: 12px;
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.sidebar {
  background-color: var(--light-gray);
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.sidebar h3 {
  margin-top: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.stat-card {
  background-color: var(--container-bg);
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  color: var(--dark-gray);
}

@media (max-width: 768px) {
  .tabs {
      flex-direction: column;
  }
  
  .tab {
      margin-bottom: 5px;
      border-bottom: 1px solid var(--border-color);
      border-radius: 4px;
  }
  
  .search-box input {
      width: 100%;
  }

  .loading-indicator {
      text-align: center;
      padding: 10px;
      color: var(--info-color);
      font-weight: bold;
      background-color: rgba(33, 150, 243, 0.1);
      border-radius: 4px;
      margin: 10px 0;
  }

  .loading-spinner {
      border: 4px solid rgba(0, 0, 0, 0.1);
      border-radius: 50%;
      border-top: 4px solid var(--info-color);
      width: 30px;
      height: 30px;
      animation: spin 1s linear infinite;
      margin: 15px auto;
  }

  /* 全局搜索样式 */
  .global-search {
      display: flex;
      margin: 15px 0;
      position: relative;
      z-index: 10;
      max-width: 500px;
      margin: 20px auto;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
      border-radius: 25px;
      overflow: hidden;
      transition: all 0.3s ease;
      background-color: var(--container-bg);
      border: 1px solid var(--border-color);
  }

  .global-search:focus-within {
      box-shadow: 0 2px 15px rgba(0,0,0,0.2);
      transform: translateY(-2px);
      border-color: var(--primary-color);
  }

  .global-search input {
      flex: 1;
      padding: 12px 20px;
      border: none;
      background-color: transparent;
      color: var(--text-color);
      font-size: 15px;
      outline: none;
  }

  .global-search button {
      padding: 12px 20px;
      background-color: var(--primary-color);
      color: white;
      border: none;
      cursor: pointer;
      transition: all 0.3s;
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: center;
  }

  .global-search button:hover {
      background-color: var(--primary-dark);
      transform: scale(1.05);
  }

  .global-search button:active {
      transform: scale(0.95);
  }

  /* 搜索结果弹出框样式 */
  .search-results-popup {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background-color: white;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: var(--shadow);
      z-index: 100;
      max-height: 400px;
      overflow-y: auto;
      margin-top: 5px;
  }

  .search-results-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 20px;
      border-bottom: 1px solid var(--border-color);
      background-color: var(--light-gray);
      border-radius: 8px 8px 0 0;
  }

  .search-results-header h3 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
  }

  .search-results-list {
      padding: 5px;
  }

  .search-result-item {
      padding: 15px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      transition: background-color 0.2s;
      cursor: pointer;
  }

  .search-result-item:hover {
      background-color: rgba(76, 175, 80, 0.1);
  }

  .search-result-item:last-child {
      border-bottom: none;
  }

  .search-result-item .result-title {
      font-weight: 600;
      margin-bottom: 5px;
      font-size: 15px;
  }

  .search-result-item .result-subtitle {
      font-size: 13px;
      color: var(--dark-gray);
      margin-bottom: 10px;
  }

  .search-result-item .btn-sm {
      align-self: flex-start;
      padding: 6px 12px;
      font-size: 12px;
      background-color: var(--primary-color);
      border: none;
      border-radius: 4px;
      color: white;
      cursor: pointer;
      transition: background-color 0.2s;
  }

  .search-result-item .btn-sm:hover {
      background-color: var(--primary-dark);
  }

  .search-result-item.user .result-title {
      color: var(--info-color);
  }

  .search-result-item.post .result-title {
      color: var(--success-color);
  }

  .search-result-item.category .result-title {
      color: var(--warning-color);
  }

  .search-result-item.comment .result-title {
      color: var(--primary-color);
  }

  .no-results {
      padding: 25px;
      text-align: center;
      color: var(--dark-gray);
      font-style: italic;
  }

  .header-actions {
      display: flex;
      justify-content: flex-end;
      margin-top: 10px;
  }

  .theme-toggle {
      background: none;
      border: none;
      font-size: 20px;
      cursor: pointer;
      padding: 5px;
      border-radius: 50%;
      transition: background-color 0.3s;
  }

  .theme-toggle:hover {
      background-color: rgba(0, 0, 0, 0.1);
  }

  body.dark-theme .theme-toggle:hover {
      background-color: rgba(255, 255, 255, 0.1);
  }

  @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
  }
}